package modelLayer;



import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The test class test2.
 *
 * @author  (your name)
 * @version (a version number or a date)
 */
public class test2
{
    /**
     * Default constructor for test class test2
     */
    public test2()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    @Before
    public void setUp()
    {
    }

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    @After
    public void tearDown()
    {
    }

    

    @Test
    public void opretOrdre()
    {
        modelLayer.Erhverv erhverv1 = new modelLayer.Erhverv("firm", "123456");
        modelLayer.Rettigheder[] result = modelLayer.Rettigheder.values();
        modelLayer.Rettigheder aNSAT1 = result[0];
        modelLayer.Ansat ansat1 = new modelLayer.Ansat(1, "log", aNSAT1);
        modelLayer.Person person1 = new modelLayer.Person(ansat1, null, "a", "b", "c", "d", "e", "f");
        modelLayer.Person person2 = new modelLayer.Person(null, erhverv1, "g", "h", "i", "j", "k", "l");
        modelLayer.Ordre ordre1 = new modelLayer.Ordre("stat", person1, person2);
        modelLayer.MarkedsVare markedsV1 = new modelLayer.MarkedsVare(Lokation.TRAELASTHANDEL, "typ", "beskrv", 50, 100, 10, 40);
        modelLayer.DelOrdre delOrdre1 = new modelLayer.DelOrdre(markedsV1, 4);
        ordre1.tilfoejDelOrdre(delOrdre1);
        modelLayer.Eksemplar eksempla1 = new modelLayer.Eksemplar("12345", false, -1);
        markedsV1.tilfoejEksemplar(eksempla1);
        modelLayer.AftaleContainer aftaleCo1 = modelLayer.AftaleContainer.getInstance();
        aftaleCo1.tilfoejAftale(ordre1);
        assertNotNull(aftaleCo1.findAftale(1));
    }
}


